#include <iostream>
#include <vector>

int findMaxConsecutiveOnes(std::vector<int>& nums) {
    int maxCount = 0;
    int count = 0;
    for (int num : nums) {
        if (num == 1) {
            count++;
            maxCount = std::max(maxCount, count);
        } else {
            count = 0;
        }
    }
    return maxCount;
}

int main() {
    std::vector<int> nums = {1, 1, 0, 1, 1, 1};
    int maxConsecutiveOnes = findMaxConsecutiveOnes(nums);
    std::cout << "The maximum number of consecutive ones is: " << maxConsecutiveOnes << std::endl;
    return 0;
}
